package common.mq.po;

import java.io.Serializable;
import java.util.Map;

public class Message implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -9102082857170599200L;

	
	private String id; // 编号
	private int overdueTime;// 过期时间
	private int receiveTime;// 接收时间
	private String category;// 类别名
	private MessType type;// 消息类型
	private Map<String, String> content;// 消息内容
	private RepeatType repeatType;// 排重方式
	private boolean isRepeat;// 是否排重
	private TimingType timingType;// 定时类型
	private int nextTime;// 下次执行时间
	private int count;// 执行次数
	private ExceType exceType;//异常类型

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public MessType getType() {
		return type;
	}

	public void setType(MessType type) {
		this.type = type;
	}

	public boolean isRepeat() {
		return isRepeat;
	}

	public void setRepeat(boolean isRepeat) {
		this.isRepeat = isRepeat;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public void setOverdueTime(int overdueTime) {
		this.overdueTime = overdueTime;
	}

	public int getOverdueTime() {
		return overdueTime;
	}

	public void setReceiveTime(int receiveTime) {
		this.receiveTime = receiveTime;
	}

	public int getReceiveTime() {
		return receiveTime;
	}

	public void setTimingType(TimingType timingType) {
		this.timingType = timingType;
	}

	public TimingType getTimingType() {
		return timingType;
	}

	public void setNextTime(int nextTime) {
		this.nextTime = nextTime;
	}

	public int getNextTime() {
		return nextTime;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public int getCount() {
		return count;
	}

	public void setExceType(ExceType exceType) {
		this.exceType = exceType;
	}

	public ExceType getExceType() {
		return exceType;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getId() {
		return id;
	}
	
	public String toString(){
	    StringBuilder sb = new StringBuilder("Message(");
	    
	    sb.append("id:");
	    sb.append(this.id);
	    sb.append(", ");
	    sb.append("overdueTime:");
	    sb.append(this.overdueTime);
	    sb.append(", ");
	    sb.append("receiveTime:");
	    sb.append(this.receiveTime);
	    sb.append(", ");
	    sb.append("category:");
	    if (this.category == null) {
	      sb.append("null");
	    } else {
	      sb.append(this.category);
	    }
	    sb.append(", ");
	    sb.append("type:");
	    sb.append(this.type);
	    sb.append(", ");
	    sb.append("content:");
	    if (this.getContent() == null) {
	      sb.append("null");
	    } else {
	      sb.append(this.getContent());
	    }
	    sb.append(", ");
	    sb.append("repeatType:");
	    sb.append(this.getRepeatType());
	    sb.append(", ");
	    sb.append("isRepeat:");
	    sb.append(this.isRepeat);
	    sb.append(", ");
	    sb.append("timingType:");
	    sb.append(this.timingType);
	    sb.append(", ");
	    sb.append("nextTime:");
	    sb.append(this.nextTime);
	    sb.append(", ");
	    sb.append("count:");
	    sb.append(this.count);
	    sb.append(", ");
	    sb.append("exceType:");
	    sb.append(this.exceType);
	    return sb.toString();
	}
	
	public Message clone(){
		Message m = new Message();
		m.setId(this.id);
		m.setOverdueTime(overdueTime);
		m.setReceiveTime(receiveTime);
		m.setCategory(category);
		m.setType(type);
		m.setContent(getContent());
		m.setRepeatType(getRepeatType());
		m.setRepeat(isRepeat);
		m.setTimingType(timingType);
		m.setNextTime(nextTime);
		m.setCount(count);
		m.setExceType(exceType);
		return m;		
	}

	public void setRepeatType(RepeatType repeatType) {
		this.repeatType = repeatType;
	}

	public RepeatType getRepeatType() {
		return repeatType;
	}

	public void setContent(Map<String, String> content) {
		this.content = content;
	}

	public Map<String, String> getContent() {
		return content;
	}

}
